package com.platform.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.platform.server.entity.VideoComment;
import com.platform.server.service.VideoService;

@Controller
@RequestMapping("/video")
public class VideoController {

	@Autowired
	private VideoService videoService;
	
	/**
	 * 查看我的视频列表
	 */
	@ResponseBody
	@RequestMapping(value = "/selectVideoList",method = RequestMethod.POST)
	public Object selectVideoList(String id){
		return videoService.selectVideoList(id);
	}
	
	/**
	 * 个人视频详情
	 */
	@ResponseBody
	@RequestMapping(value = "/selectCommentList",method = RequestMethod.POST)
	public Object selectCommentList(String videoid){
		return videoService.selectCommentList(videoid);
	}
	
	/**
	 * 删除视频
	 */
	@ResponseBody
	@RequestMapping(value = "/deleteVideo",method = RequestMethod.POST)
	public Object deleteVideo(Integer videoid){
		return videoService.deleteVideo(videoid);
	}
	
	/**
	 * 视频点赞
	 */
	@ResponseBody
	@RequestMapping(value = "/videoLike",method = RequestMethod.POST)
	public Object videoLike(String userid,String videoid){
		return videoService.videoLike(userid,videoid);
	}
	
	/**
	 * 发表视频评论
	 */
	@ResponseBody
	@RequestMapping(value = "/insertVideoComment",method = RequestMethod.POST)
	public Object insertVideoComment(VideoComment videoComment){
		return videoService.insertVideoComment(videoComment);
	}
	
	/**
	 * 删除视频评论
	 */
	@ResponseBody
	@RequestMapping(value = "/deleteVideoComment",method = RequestMethod.POST)
	public Object deleteVideoComment(Integer id){
		return videoService.deleteVideoComment(id);
	}
}
